<div class="easyui-layout" fit="true">
	<div region="center" border="false" style="overflow:auto;padding:5px;background:#fff;border:1px solid #ccc;height:<?=$tinggiregion?>px;"> 
	<?php if($type == "user_list"){?>
            <fieldset>
                <form  method="post" id="<?=$type?>_form" url="<?=base_url()?>setup/saveData/<?=$type?>" enctype="multipart/form-data">
                    <input type="hidden" name="editstatus" id="STS" value="<?=$editstatus;?>" />  
                    <input type="hidden" name="id" id="STS" value="<?=isset($datarecord['id'])?$datarecord['id']:''?>" />
                      <table cellpadding="0" cellspacing="2" style="padding-top:0px;width:500px;">
                          <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">User Name</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                  <input type="text" name="username" id="USERNAME"  value="<?=isset($datarecord['username'])?$datarecord['username']:''?>" style="width:300px; border: 1px solid silver; padding: 1px;"/>
                              </td>
                          </tr>
                          <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Password</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                  <input type="password" name="password" id="PASS"  value="<?=isset($datarecord['password'])?$datarecord['password']:''?>" style="width:300px; border: 1px solid silver; padding: 1px;"/>
                              </td>
                          </tr>
                          <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Email</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                  <input type="text" name="email" id="EMAIL"  value="<?=isset($datarecord['email'])?$datarecord['email']:''?>" style="width:300px; border: 1px solid silver; padding: 1px;"/>
                              </td>
                          </tr>
                          <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Full Name</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                  <input type="text" name="fullname" id="REAL_NAME"  value="<?=isset($datarecord['fullname'])?$datarecord['fullname']:''?>" style="width:300px; border: 1px solid silver; padding: 1px;"/>
                              </td>
                          </tr>
                          <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Position</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                  <input type="text" name="position" id="POSITION"  value="<?=isset($datarecord['position'])?$datarecord['position']:''?>" style="width:300px; border: 1px solid silver; padding: 1px;"/>
                              </td>
                          </tr>
                          <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Group User</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                  <select id="GROUP_ID" name="group_user_id" style="width:300px; border: 1px solid silver; padding: 1px;">
                                      <?=$idx_user_group?>
                                  </select>
                              </td>
                          </tr>
                          <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">SubGroup User</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                  <select id="CL_USER_SUBGROUP_ID" name="sub_group_id" style="width:300px; border: 1px solid silver; padding: 1px;">
                                      <?=$idx_user_subgroup?>
                                  </select>
                              </td>
                          </tr>
                          <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Level User</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                  <select id="USER_LEVEL_ID" name="user_level_id" style="width:300px; border: 1px solid silver; padding: 1px;">
                                      <?=$idx_user_level?>
                                  </select>
                              </td>
                          </tr>                                            
                      </table>
                </form>
                <fieldset >
                <legend>ROLES</legend>
                        <table border="0" width="100%">
                            <input id="role_id" value="<?=$editstatus?>" type="hidden"/>
                                <tr><td align="center">
                                        Available  : <br>
                                        <select size=6 id="usrm_role1" style="width:200px;" multiple="true" name="role1">
                                                <?=$idx_user_role?>
                                        </select>
                                </td><td width="100px" style="padding:3px;" align="center"> 

                                <button  id="usrm_toright"  iconCls="icon-user_add"> ==>> </button>  <br> <br>
                                <button  id="usrm_toleft" iconCls="icon-user_delete"> <<== </button>  <br> <br>

                                </td>
                                <td align="center">
                                        Member of : <br>
                                        <select size=6 id="usrm_role" style="width:200px;" multiple="true" name="role">
                                                <?=$idx_user_member?>
                                        </select>
                                </td></tr>
                        </table>

                </fieldset>
            </fieldset>
	<?php }elseif($type == 'user_level'){ ?>
            <fieldset>
		<form  method="post" id="<?=$type?>_form" url="<?=base_url()?>setup/saveData/<?=$type?>" >
                    <input type="hidden" name="editstatus" id="STS" value="<?=$editstatus;?>" />  
                    <input type="hidden" name="id" id="STS" value="<?=isset($datarecord['id'])?$datarecord['id']:''?>" />
                    <table cellpadding="0" cellspacing="2" style="padding-top:0px;width:500px;">
                          <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">User Level</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                  <input type="text" name="level" id="USER_LEVEL" class="easyui-validatebox" style="width:300px; border: 1px solid silver; padding: 1px;" value="<?=isset($datarecord['level'])?$datarecord['level']:''?>" />
                              </td>
                    </table>
                </form>
            </fieldset>
	<?php }elseif($type == "user_group"){ ?>
		<fieldset>
                    <form  method="post" id="<?=$type?>_form" url="<?=base_url()?>setup/saveData/<?=$type?>" >
                        <input type="hidden" name="editstatus" id="STS" value="<?=$editstatus;?>" />  
                        <input type="hidden" name="id" id="STS" value="<?=isset($datarecord['id'])?$datarecord['id']:''?>" />
                        <table cellpadding="0" cellspacing="2" style="padding-top:0px;width:500px;">
                            <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Group Code</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                   <input type="text" name="id" id="GROUP_ID"  style="width:40px; border: 1px solid silver; padding: 1px;" maxlength="10" value="<?=isset($datarecord['id'])?$datarecord['id']:''?>" />
                              </td>
                            </tr>
                            <tr>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Group User</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">:</td>
                              <td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">
                                   <input type="text" name="group" id="GROUP"  style="width:300px; border: 1px solid silver; padding: 1px;" value="<?=isset($datarecord['group'])?$datarecord['group']:''?>" />
                              </td>
                            </tr>
                        </table>
                    </form>
		</fieldset>		
	<?php }elseif($type == "user_role"){ ?>
		<fieldset>
                    <form  method="post" id="<?=$type?>_form" url="<?=base_url()?>setup/saveData/<?=$type?>" >
                            <input type="hidden" name="editstatus" id="STS" value="<?=$editstatus;?>" />  
                            <input type="hidden" name="id" id="STS" value="<?=isset($datarecord['id'])?$datarecord['id']:''?>" />
                            <label>Role Name</label>: 
                                            <input type="text" name="role" id="ROLE_NAME"  style="width:300px; border: 1px solid silver; padding: 1px;" value="<?=isset($datarecord['role'])?$datarecord['role']:''?>" /> <br />
                    </form>
		</fieldset>				
	<?php }elseif($type == "app_modules"){ ?>
		<fieldset>
                    <form  method="post" id="<?=$type?>_form" url="<?=base_url()?>setup/saveData/<?=$type?>" >
                            <input type="hidden" name="editstatus" id="STS" value="<?=$editstatus;?>" />  
                            <input type="hidden" name="id" id="STS" value="<?=isset($datarecord['id'])?$datarecord['id']:''?>" />
                            <label>Module Name</label>: 
                            <input type="text" name="module_name" id="MODULE_NAME"  style="width:300px; border: 1px solid silver; padding: 1px;" value="<?=isset($datarecord['module_name'])?$datarecord['module_name']:''?>" /> <br />
                    </form>
		</fieldset>
	<?php }elseif($type == "app_functions"){ ?>
                <fieldset>
                    <form  method="post" id="<?=$type?>_form" url="<?=base_url()?>setup/saveData/<?=$type?>" >
                            <input type="hidden" name="editstatus" id="STS" value="<?=$editstatus;?>" />  
                            <input type="hidden" name="id" id="STS" value="<?=isset($datarecord['id'])?$datarecord['id']:''?>" />
                            <label>Module Name</label>:  
                            <select id="tbl_module_id" name="tbl_module_id">
                                <?=$module?>
                            </select><br />

                            <label>Function Name</label>: 
                                <input type="text" name="function_name" id="function_name"  style="width:222px; border: 1px solid silver; padding: 1px;" value="<?=isset($datarecord['function_name'])?$datarecord['function_name']:''?>" /> <br />
                    </form>
                </fieldset>
	<?php }?>
        
        <?php if($editstatus== "role"){?>
            <fieldset>
                ROLSE
            </fieldset>
         <?php } ?>
	</div>
    

	<div region="south" border="false" style="text-align:right;padding:5px 0;">
		<a id="btnSend_<?=$type?>" class="l-btn l-btn-plain" iconcls="disk" href="#">
            <span class="l-btn-left">
                <span class="l-btn-text disk" style="padding-left: 20px;">Simpan</span>
            </span>
        </a>
		<a id="btnBatal_<?=$type?>" class="l-btn l-btn-plain" onclick="kembali('<?=$type?>')" iconcls="cancel" href="#">
            <span class="l-btn-left">
                <span class="l-btn-text cancel" style="padding-left: 20px;">Batal</span>
            </span>
        </a>
	</div>
</div>

<script>
	var type = "<?=$type?>";
	var editstatus = "<?=$editstatus?>";
	
	<?php if($type == 'motor' || $type == 'generator' || $type == 'sparepart' || $type == 'peralatan_service' || $type == 'barang_promosi'){?>
		var kategoribarang = "<?=($editstatus == 'edit' ? $datarecord->id_kategori_barang : '')?>";
		var kondisippnjual = "<?=$optkondisippnjual?>";
		var tingkathrgjual = "<?=$opttingkathrgjual?>";
	<?php } ?>
	<?php if($type == 'karyawan'){?>
		var tglmulaikerja = "<?=($editstatus == 'edit' ? $datarecord->tanggal_masuk_kerja : '')?>";
	<?php } ?>
	<?php if($type == 'service'){?>
		var kategoriservice = "<?=($editstatus == 'edit' ? $datarecord->id_kategori_service : '')?>";
	<?php } ?>
	<?php if($type == 'aktiva'){?>
		var tglpembelian = "<?=($editstatus == 'edit' ? $datarecord->tanggal_pembelian : '')?>";
		var tglpemakaian = "<?=($editstatus == 'edit' ? $datarecord->tanggal_pemakaian : '')?>";
	<?php } ?>
	<?php if($type == 'akun_kas' || $type == 'akun_aktifa_tetap'){?>
		var id_dealer = "<?=($editstatus == 'edit' ? $datarecord->id_dealer : '')?>";
		<?php if($type == 'akun_kas') { ?> 
			var id_kas = "<?=($editstatus == 'edit' ? $datarecord->id_kas : '')?>"; 
		<?php } ?>;
	<?php } ?>
	<?php if($type == 'akun_barang_jasa'){ ?>
		var kategoribarang = "<?=($editstatus == 'edit' ? $datarecord->id_group_barang : '')?>";
	<?php } ?>
</script>
<script type="text/javascript" src="<?=base_url()?>assets/js/setup/setup_form.js"></script>
